{layout "../Layout/layout.latte"}
{block private_js}
    <script type="text/javascript">
        $(function () {
            $("#bnt").click(function () {
                $.ajax({
                    type: "post",
                    url: $("#formArticle").attr("action"),
                    data: $("#formArticle").serialize(),
                    cache: false,
                    dataType: "json",
                    success: function (data) {
                        if (data.status == "n") {
                            $.toast(data.info);
                            return false;
                        } else {
                            $.toast(data.info);
                            setTimeout(function () {
                                $.showPreloader();
                                location.replace(data.url);
                            }, 2000);
                        }
                    }
                });
            });
        });
        function deleteAdr(atr) {
            $.confirm('是否确认删除?', function () {
                var dele = $(atr);
                $.ajax({
                    type: "post",
                    url: dele.attr("data-url"),
                    data: " ",
                    cache: false,
                    dataType: "json",
                    success: function (data) {
                        if (data.status == "n") {
                            $.toast(data.info);
                            return false;
                        } else {
                            $.toast(data.info);
                            setTimeout(function () {
                                $.showPreloader();
                                location.replace(data.url);
                            }, 2000);
                        }
                    }
                });
            });
        }

    </script>
{/block}
{block private_css}
    <style type="text/css">
        .list-block{
            margin:0;
        }
    </style>
{/block}
{block content}
    <form id="formArticle" class="stdform mform" method="post" action="" onsubmit="return false">
        <div class="list-block">
            <ul>
                <!-- Text inputs -->
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-email"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">项目名称</div>
                            <div class="item-input">
                                <input type="text" id="names" placeholder="项目名称" class="" name="names" value="{$lists['names']}">
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <div class="item-content">
                        <div class="item-media"><i class="icon icon-form-email"></i></div>
                        <div class="item-inner">
                            <div class="item-title label">说明</div>
                            <div class="item-input">
                                <textarea name="memo">{$lists['memo']}</textarea>
                            </div>
                        </div>
                    </div>
                </li>

            </ul>
        </div>
    </form>
    <div class="content-block">
        <div class="row">
            <div class="col-50">
            <a href="#" class="button button-big button-fill button-danger" data-url="{url('mobileConsoles_task_groupDelete',array("id"=>$lists['id']))}" onclick="deleteAdr($(this))">删除</a>
            </div>
            <div class="col-50">
                <a href="#" class="button button-big button-fill" id="bnt">提交</a>
            </div>
        </div>
    </div>
{/block}